﻿Imports Microsoft.VisualBasic

Public Class clsDil
    Private dil As String
    Private dilno As Integer
    Public Sub New()
        dil = System.Web.HttpContext.Current.Request.ServerVariables("HTTP_ACCEPT_LANGUAGE").ToLower
        If InStr(dil, "tr") > 0 Then
            dil = "tr"
            dilno = 0
        ElseIf InStr(dil, "fr") > 0 Then
            dil = "fr"
            dilno = 2
        Else
            dil = "en"
            dilno = 3
        End If
    End Sub
    Public Function Lang(ByVal deger As Integer) As String
        Try
            Return System.Web.HttpContext.GetGlobalResourceObject("resDil", "d" + Right(("0" + deger.ToString), 2) + "_" + dil)
        Catch ex As Exception
            Return "?"
        End Try
    End Function
End Class
